package com.huizu.goods.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huizu.goods.mapper.ShopOrderMapper;
import com.huizu.goods.domain.ShopOrder;
import com.huizu.goods.domain.ShopOrderDetail;
import com.huizu.goods.service.IShopOrderService;
import com.huizu.common.core.text.Convert;

/**
 * 订单主信息Service业务层处理
 * 
 * meidouhui
 * @date 2020-04-22
 */
@Service
public class ShopOrderServiceImpl implements IShopOrderService {
	@Autowired
	private ShopOrderMapper shopOrderMapper;

	/**
	 * 查询订单主信息
	 * 
	 * @param id
	 *            订单主信息ID
	 * @return 订单主信息
	 */
	@Override
	public ShopOrder selectShopOrderById(Long id) {
		return shopOrderMapper.selectShopOrderById(id);
	}

	/**
	 * 查询订单主信息列表
	 * 
	 * @param shopOrder
	 *            订单主信息
	 * @return 订单主信息
	 */
	@Override
	public List<ShopOrder> selectShopOrderList(ShopOrder shopOrder) {
		return shopOrderMapper.selectShopOrderList(shopOrder);
	}

	/**
	 * 新增订单主信息
	 * 
	 * @param shopOrder
	 *            订单主信息
	 * @return 结果
	 */
	@Override
	public int insertShopOrder(ShopOrder shopOrder) {
		return shopOrderMapper.insertShopOrder(shopOrder);
	}

	/**
	 * 修改订单主信息
	 * 
	 * @param shopOrder
	 *            订单主信息
	 * @return 结果
	 */
	@Override
	public int updateShopOrder(ShopOrder shopOrder) {
		return shopOrderMapper.updateShopOrder(shopOrder);
	}

	/**
	 * 删除订单主信息对象
	 * 
	 * @param ids
	 *            需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int deleteShopOrderByIds(String ids) {
		return shopOrderMapper.deleteShopOrderByIds(Convert.toStrArray(ids));
	}

	/**
	 * 删除订单主信息信息
	 * 
	 * @param id
	 *            订单主信息ID
	 * @return 结果
	 */
	@Override
	public int deleteShopOrderById(Long id) {
		return shopOrderMapper.deleteShopOrderById(id);
	}

	/**
	 * 商品详情
	 */
	public List<ShopOrderDetail> getlistChile(ShopOrder shopOrder){
		List<ShopOrderDetail> list=shopOrderMapper.getlistChile(shopOrder);
		return list;
	}
	
	/**
     * 物流信息
     */
    
    public List<Map<String,Object>> getExpress(){
    	return shopOrderMapper.getExpress();
    }
}
